Networks

class Networks(dockerClient: DockerClient)

Docker networks operations using the owning DockerClient.

Result-returning methods report daemon HTTP errors as ErrorResponse. Transport/decoding failures and cancellation can throw. Live flows report request failures during collection.

Constructors

Link copied to clipboard
constructor(dockerClient: DockerClient)

Functions

Link copied to clipboard
suspend fun connect(id: String, connectionConfig: NetworkConnectRequest): Result<Unit, ErrorResponse>

Connect a container to a network

Link copied to clipboard
suspend fun create(networkConfig: NetworkCreateRequest): Result<NetworkCreateResponse, ErrorResponse>

Create a network

Link copied to clipboard
suspend fun disconnect(id: String, connectionConfig: NetworkDisconnectRequest): Result<Unit, ErrorResponse>

Disconnect a container from a network

Link copied to clipboard
suspend fun inspect(id: String, verbose: Boolean = false, scope: String? = null): Result<Network, ErrorResponse>

Inspect a network

Link copied to clipboard
suspend fun list(filters: Map<String, List<String>>? = null): Result<List<Network>, ErrorResponse>

List networks

Link copied to clipboard
suspend fun prune(filters: Map<String, List<String>>? = null): Result<NetworkPruneResponse, ErrorResponse>

Delete unused networks

Link copied to clipboard
suspend fun remove(id: String): Result<Unit, ErrorResponse>

Deletes a network; disconnect attached containers first when required by Docker.